var OnlineStoreBaseTemplateCustomJSModule = { after_getting_cart_summary: function () { window.theme.Nav.events(); }, after_change_checkout_step: function () { if ($.isFunction($.fn['themePluginSticky']) && $('[data-plugin-sticky]').length) { $('.checkout-totals [data-plugin-sticky]').each(function () { var $this = $(this), opts; var pluginOptions = theme.fn.getOptions($this.data('plugin-options')); if (pluginOptions) opts = pluginOptions; $this.themePluginSticky(opts); }); $(window).trigger('resize'); } } } /** * Add overlay for each Bootstrap modal shown, because in Bootstrap 4 multiple modal opening with a backdrop * with a different z-index for each modal is not allowed by default. */ $(document).on('show.bs.modal', '.modal', function () { var z_index = 1040 + (10 * $('.modal:visible').length); $(this).css('z-index', z_index); setTimeout(function () { $('.modal-backdrop').not('.modal-stack').css('z-index', z_index - 1).addClass('modal-stack'); }, 0); }); /** * This is added for a scrolling issue with multiple modals with the previous hack. */ $(document).on('hidden.bs.modal', '.modal', function () { $('.modal:visible').length && $(document.body).addClass('modal-open'); setTimeout(function () { if ($('.modal:visible').length == 0) { $('.modal-backdrop.modal-stack').remove(); } }, 100) });